{% extends 'df_goods/base.html' %}
{% block detail %}
    <div class="r_wrap fr clearfix">
        <div class="sort_bar">
            <a href="{% url 'goods:list' typeinfo.id 1 1 %}" {% if sort == 1 %} class="active"{% endif %}>默认</a>
            <a href="{% url 'goods:list' typeinfo.id 1 2 %}" {% if sort == 2 %} class="active"{% endif %}>价格</a>
            <a href="{% url 'goods:list' typeinfo.id 1 3 %}" {% if sort == 3 %} class="active"{% endif %}>人气</a>
        </div>

        <ul class="goods_type_list clearfix">
            {% for foo in page %}
                <li>
                    <a href="/{{ foo.id }}"><img src="/media/{{ foo.gpic }}"></a>
                    <h4><a href="/{{ foo.id }}">{{ foo.gtitle }}</a></h4>
                    <div class="operate">
                        <span class="prize">￥{{ foo.gprice }}</span>
                        <span class="unit">{{ foo.gunit }}</span>
                        <a href="{% url 'cart:add' foo.id 1 %}" class="add_goods" title="加入购物车"></a>
                    </div>
                </li>
            {% endfor %}
        </ul>

        <div class="pagenation">
            {% if page.h.has_previous %}
                <a href="{% url 'goods:list' typeinfo.id page.previous_page_number sort %}">上一页</a>
            {% endif %}
            {% for index in paginator.page_range %}
                {% if index == page.number %}
                    <a href="#" class="active">{{ index }}</a>
                {% else %}
                    <a href="{% url 'goods:list' typeinfo.id index sort %}">{{ index }}</a>
                {% endif %}
            {% endfor %}
            {% if page.has_previous %}
                <a href="{% url 'goods:list' typeinfo.id page.next_page_number sort %}">下一页</a>
            {% endif %}
        </div>
    </div>
{% endblock %}



